package com.sina.weibo;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.os.Build.VERSION;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import java.io.File;

public class WeiboApplication extends Application
{
  public static String CACHE_DIR;
  public static String DEVICE_NAME;
  public static String HARDWARE_VERSION = "No hardware version";
  private static int HEIGHT = 0;
  public static final int HIGH_MODE = 0;
  public static String IMEI_NUM;
  public static final int LOW_MODE = 2;
  public static String ME;
  public static final int MIDDLE_MODE = 1;
  public static String TELEPHONE_NUM;
  public static String UA;
  private static int WIDTH;
  public static Context globleContext;

  static
  {
    DEVICE_NAME = "No device name";
    TELEPHONE_NUM = "";
    IMEI_NUM = "";
    CACHE_DIR = "";
    ME = "";
    UA = "";
    HEIGHT = 0;
    WIDTH = 0;
  }

  public static int getTitleDisplayMode()
  {
    int i = HEIGHT;
    int k;
    if (800 > i)
    {
      int j = WIDTH;
      if (800 > j);
    }
    else
    {
      k = 0;
    }
    while (true)
    {
      return k;
      int m = HEIGHT;
      if (320 < m)
      {
        int n = WIDTH;
        if (240 < n);
      }
      else
      {
        k = 2;
        continue;
      }
      k = 1;
    }
  }

  private String getVersionName()
  {
    PackageManager localPackageManager = getPackageManager();
    try
    {
      String str1 = getPackageName();
      str2 = localPackageManager.getPackageInfo(str1, 64).versionName;
      return str2;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      while (true)
        String str2 = "";
    }
  }

  public static void setDisplay(int paramInt1, int paramInt2)
  {
    HEIGHT = paramInt2;
    WIDTH = paramInt1;
  }

  public void onCreate()
  {
    super.onCreate();
    ME = getString(2131427445);
    HEIGHT = 0;
    WIDTH = 0;
    globleContext = getBaseContext();
    CACHE_DIR = getCacheDir().getAbsolutePath();
    boolean bool = Utils.SetWeiboDB(SinaWeiboDB.getInstance(this));
    TelephonyManager localTelephonyManager = (TelephonyManager)getSystemService("phone");
    TELEPHONE_NUM = localTelephonyManager.getLine1Number();
    IMEI_NUM = localTelephonyManager.getDeviceId();
    HARDWARE_VERSION = Build.VERSION.RELEASE;
    DEVICE_NAME = Build.MODEL;
    String str1 = String.valueOf(DEVICE_NAME);
    StringBuilder localStringBuilder1 = new StringBuilder(str1).append("_");
    String str2 = HARDWARE_VERSION;
    StringBuilder localStringBuilder2 = localStringBuilder1.append(str2).append("_").append("weibo").append("_");
    String str3 = getVersionName();
    UA = str3 + "_" + "meizu_m9";
    SharedPreferences localSharedPreferences = getSharedPreferences("weibo", 0);
    StaticInfo.mUsername = localSharedPreferences.getString("username", "");
    StaticInfo.mPassword = localSharedPreferences.getString("password", "");
    StaticInfo.mUser = Utils.loadUserFile(getCacheDir().getAbsolutePath());
    if ((TextUtils.isEmpty(StaticInfo.mUsername)) || (TextUtils.isEmpty(StaticInfo.mPassword)) || (StaticInfo.mUser == null))
      Utils.logd("warning...");
  }

  public void onLowMemory()
  {
    super.onLowMemory();
  }

  public void onTerminate()
  {
    super.onTerminate();
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.WeiboApplication
 * JD-Core Version:    0.6.0
 */